﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;


typedef struct
{
	double eps;
}Context;
Context context = { 0 };


void read_data(Context* ctx)
{
	scanf("%lf", &ctx->eps);
}


void solve(Context* ctx)
{
	double pi = 1;
	double n1 = 1;
	double k = 0;
	double n2_1 = 1;
	double i = 0;
	do
	{
		n1 *= (++k);
		n2_1 *= (2 * k + 1);
		i = n1 / n2_1;
		pi += i;
	}while (i >= ctx->eps);

	printf("%.6f\n", pi*2);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-183.txt", "r", stdin);
	read_data(&context);
	solve(&context);
	return 0;
}
